package com.hl.controller;

import com.hl.domain.PsychologicalTopic.PsychologicalTopicReply;
import com.hl.service.PsychologicalTopicReplyService;
import com.hl.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/replay")
public class PsychologicalTopicReplyController {
    @Autowired
    private PsychologicalTopicReplyService psychologicalTopicReplyService;
    @GetMapping("/{id}")
    public R findByUserId(@PathVariable("id") Integer id){
        List<PsychologicalTopicReply> list = psychologicalTopicReplyService.findByUserId(id);
        if (list!= null){
            return R.success(list);
        }else {
            return R.fail("查询失败");
        }

    }
}
